Skip to content

fix: mention insertion on iOS - #137

Merged
IvanIhnatsiuk merged 1 commit into
developmentfrom
fix/mention-insertion-on-iOS
Jul 30, 2026
Merged

fix: mention insertion on iOS#137
IvanIhnatsiuk merged 1 commit into
developmentfrom
fix/mention-insertion-on-iOS

Conversation

@IvanIhnatsiuk

Copy link
Copy Markdown
Collaborator

Summary

This pull request refines how mentions are inserted into the text editor, focusing on improving the user experience and ensuring the correct handling of text selection and formatting. The main changes involve batching text insertions, updating selection logic, and ensuring that formatting is preserved.

Mention insertion and selection handling improvements:

  • Batches the insertion of the mention and the trailing space using beginEditing/endEditing to ensure atomic updates and prevent intermediate state issues.
  • Updates the selection only after both the mention and the separator are inserted, ensuring the separator remains plain text and outside the mention formatting.
  • Ensures the text view is focused after insertion, if necessary, to maintain a smooth editing experience.
  • Updates the recently changed range to cover both the mention and the trailing space, improving downstream handling of text changes.

Test Plan

  1. Open the editor screen
  2. Press on the "@" in toolbar
  3. Select any user
  4. Observe that metnion was successfully inserted

Screenshots / Videos

Screen.Recording.2026-07-30.at.18.58.58.mov

Compatibility

OS Implemented
iOS ✅❌
Android ✅❌

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Refines iOS mention insertion in the rich text editor to avoid intermediate editing states and ensure selection/formatting behave correctly when inserting a mention plus a trailing separator.

Changes:

  • Batch mention + trailing space insertion using textStorage beginEditing / endEditing for a single atomic text storage update.
  • Move selection update to after both insertions, keeping the separator outside mention formatting.
  • Ensure the text view is focused before applying the final selection, and expand recentlyChangedRange to include both the mention and trailing space.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@IvanIhnatsiuk
IvanIhnatsiuk merged commit e16e5c6 into development Jul 30, 2026
1 check passed
@IvanIhnatsiuk
IvanIhnatsiuk deleted the fix/mention-insertion-on-iOS branch July 30, 2026 17:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants